package com.indexingsystem.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.indexingsystem.boss.Vo.StatusList;
import com.indexingsystem.boss.admin.mapper.IdhTodayStorageInfosMapper;
import com.indexingsystem.boss.entity.DhTodayStorageInfos;
import com.indexingsystem.system.service.IdhTodayStorageInfosService;

/**
 * 入库明细服务.
 * 
 * @author Administrator
 * 
 */
@Service
public class DhTodayStorageInfosServiceImpl implements IdhTodayStorageInfosService {
	@Resource
	private IdhTodayStorageInfosMapper idhTodayStorageInfosMapper;

	/**
	 * 产品审核后同步更新入库明细审核状态.
	 */
	@Override
	public int updateTodayStorageInfosByResIdList(List<StatusList> list) {
		return idhTodayStorageInfosMapper.updateTodayStorageInfosByResIdList(list);
	}
	
	/**
	 * 批量删除入库明细.
	 * @param list
	 * @return
	 */
	@Override
	public int deleteResourcesByIdBatch(List<String> list){
		return idhTodayStorageInfosMapper.deleteResourcesByIdBatch(list);
	}
	
	   /**
     * 通过主键id删除当日入库明细.
     * @param storageId
     * @return
     */
	@Override
    public int deleteTodayStorageInfoById(String storageId){
        return idhTodayStorageInfosMapper.deleteTodayStorageInfoById(storageId);
    }
	
    /**
     * 获取入库批次号.
     * @return
     */
	 @Override
	 public List<Integer> getTodayStorageInfoBatchNumList(){
//	     return idhTodayStorageInfosMapper.getTodayStorageInfoBatchNumList();
		 return null;
	 }

	@Override
	public int insert(DhTodayStorageInfos dhTodayStorageInfos) {
		return idhTodayStorageInfosMapper.insert(dhTodayStorageInfos);
	}

	@Override
	public Integer countBatch() {
		return idhTodayStorageInfosMapper.countBatch();
	}
	
    /**
     * 根据userId获取入库记录，校验入库是否已存在，如果存在不允许删除。
     * @param userId
     * @return
     */
    @Override
    public int getTodayStorageInfosByUserId(String userId){
        return idhTodayStorageInfosMapper.getTodayStorageInfosByUserId(userId);
    }
    
    /**
     * 通过入库资源id获取入库记录.
     * @param resId
     * @return
     */
    @Override
    public List<DhTodayStorageInfos> getDhTodayStorageInfosByResId(String resId){
        return idhTodayStorageInfosMapper.getDhTodayStorageInfosByResId(resId);
    }

	@Override
	public List<DhTodayStorageInfos> getDhTodayStorageInfosByResIdAndForMat(String resId) {
		  return idhTodayStorageInfosMapper.getDhTodayStorageInfosByResIdAndForMat(resId);
	}
}